package com.lwx.chapter7;

public abstract class Gragh {
    abstract int V();
    //使用迭代器来实现，返回指定节点的相连节点
    class  adjIterator{
        Gragh graph;
        int v;
        int index;
        public adjIterator( Gragh graph, int v){
            this.v = v;
            this.index = 0;
            this.graph = graph;
        }

        /**
         * v节点对应的第一个元素
         * @return
         */
        int begin(){
            return -1;
        }

        /**
         *
         * @return
         */
        int next(){
            return -1;
        }

        /**
         * v节点的是否遍历结束
         * @return
         */
        boolean end(){
            return true;
        }
    }
}
